<!--
 * @Author: ssj
 * @Date: 2021-10-15 17:55:21
 * @LastEditors: wiz
 * @LastEditTime: 2023-12-22 16:36:12
 * @Description: 
-->
<template>
  <div class="o-i18n-select-cell">
    <Tooltip :content="value" theme="light">
      <span :class="{ 'read-only': renderOpts.props.disabled }">{{
        $srv.getI18nBySrv(value)
      }}</span>
    </Tooltip>
  </div>
</template>
<script lang="ts">
import { Component, Vue, Prop, Watch } from 'vue-property-decorator';
import { Tsrv } from '@/services';

@Component
export default class oI18nSelectorCell extends Vue {
  /**
   * props
   */
  @Prop() params: any;

  @Prop() renderOpts: any;

  private value = null;

  /**
   * data
   */
  @Watch('params')
  onParamsChange() {
    this.setValue();
  }

  mounted() {
    this.setValue();
  }

  setValue() {
    if (this.params.property) {
      this.value = this.params.data[this.params.property];
    } else {
      this.value = this.params.row[this.params.column.property];
    }
  }
}
</script>
